package com.duanjw.springframework.di;

import com.duanjw.springframework.di.config.AppConfig;
import com.duanjw.springframework.di.service.UserService;
import com.duanjw.springframework.di.web.UserController;
import com.duanjw.springframework.di.service.impl.UserServiceImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author duanjw
 */
public class DiApplication {
    public static void main(String[] args) {
        ApplicationContext ctx = new AnnotationConfigApplicationContext(AppConfig.class);
        ctx.getBean(UserServiceImpl.class).query();
        System.out.println(ctx.getBean(UserController.class));
    }
}
